package study;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@Service
@RefreshScope
public class HelloService {

    @Value(value = "${key:hello world}")
    private String name;
    @Value(value = "${user1.name:default}")
    private String user_name;
    @Autowired
    private User1 user1;

    @Value(value = "${server.port:8080}")
    private int port;

    public String sayHello(){
        System.out.println("port = "+port+"   user_name = "+user_name);
        return user1.toString()+" say："+name;
    }

}
